var newPasswd = document.getElementById("new-passwd");
var repeatPasswd = document.getElementById("repeat-passwd");
//function modifyPwdSumbit(){
$("#Pwd").click(function() {
	doSumit();
});
function doSumit() {
//console.log(repeatPasswd,$(repeatPasswd));
	var newPasswdv = $(newPasswd).val().trim();
	var repeatPasswdv = $(repeatPasswd).val().trim();

	if(!newPasswdv) {
		mui.toast('请输入新密码');
		return;
	}
	if(!repeatPasswdv) {
		mui.toast('请再次输入密码');
		return;
	}
	if(newPasswdv != repeatPasswdv) {
		mui.toast('两次密码输入不一致');
		return;
	}

	crossDomainAjax({
				url: apiUrl,
				pastDate: {
					"op": "Phone_UpdateLogin",
					"Login": userInfo.Pid,
					"PassWord": newPasswdv
				},
				nativeFlg: false,
				requestType: 'POST'
			}, function(result) {
				if(result.status == 0) {
					mui.toast(result.Message);
					return;
				}else{
					mui.toast("修改成功");
				}
				
				 console.log('Login: ');
        userInfo = result;
        console.log(JSON.stringify(result));
        localStorage.setItem('user_info', JSON.stringify(result.Main));
        pageChange({
            pageUrl: "index.html",
            createNew: false,
            postData: {
                pageflag: 'login.html'
            },
            aniShow: "fade-in"
        });
			});
			

		}